home *** CD-ROM | disk | FTP | other *** search
/ SPACE 1 / SPACE - Library 1 - Volume 1.iso / program / 70 / docs / mainbody < prev   
Text File  |  1987-12-25  |  30KB  |  1,350 lines

  1.  
  2.  
  3.  
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.                  A✓A✓A✓A L✓L✓L✓Li✓i✓i✓it✓t✓t✓tt✓t✓t✓tl✓l✓l✓le✓e✓e✓e S✓S✓S✓Sm✓m✓m✓ma✓a✓a✓al✓l✓l✓ll✓l✓l✓lt✓t✓t✓ta✓a✓a✓al✓l✓l✓lk✓k✓k✓k U✓U✓U✓Us✓s✓s✓se✓e✓e✓er✓r✓r✓r M✓M✓M✓Ma✓a✓a✓an✓n✓n✓nu✓u✓u✓ua✓a✓a✓al✓l✓l✓l
  11.  
  12.  
  13.                         Timothy A. Budd
  14.  
  15.  
  16.  
  17.  
  18.  
  19.  
  20.   _✓1.  _✓I_✓n_✓t_✓r_✓o_✓d_✓u_✓c_✓t_✓i_✓o_✓n
  21.  
  22.        This manual is intended as an aid in using  the  Little
  23.   Smalltalk  system.   It  is  not  intended  to be used as an
  24.   introduction to the Smalltalk language.  Little Smalltalk is
  25.   largely (with exceptions listed in a later section) a subset
  26.   of  the  Smalltalk-80*  language  described  in  [.Smalltalk
  27.   blue.].   A  complete description of the classes included in
  28.   the Little Smalltalk system and the messages they accept  is
  29.   given in Appendix 1.
  30.  
  31.   _✓2.  _✓R_✓u_✓n_✓n_✓i_✓n_✓g _✓t_✓h_✓e _✓s_✓y_✓s_✓t_✓e_✓m
  32.  
  33.        The Little Smalltalk system is invoked  by  typing  the
  34.   command  s✓s✓s✓st✓t✓t✓t.   The system is interactive - that is, the user
  35.   types an expression at the keyboard and the system  responds
  36.   by  evaluating  the  expression  and typing the result.  For
  37.   example, typing the expression 3✓3✓3✓3 +✓+✓+✓+ 4✓4✓4✓4 results in the value  7✓7✓7✓7
  38.   being  displayed  on the output.  Execution is terminated by
  39.   typing control-D.  A sample execution session  is  shown  in
  40.   Figure 1.
  41.  
  42.  
  43.                         % st
  44.                         Little Smalltalk
  45.                                 3 + 4
  46.                         7
  47.                                 ^D
  48.                         %
  49.  
  50.  
  51.           F✓F✓F✓Fi✓i✓i✓ig✓g✓g✓gu✓u✓u✓ur✓r✓r✓re✓e✓e✓e 1✓1✓1✓1:✓:✓:✓: A Sample Little Smalltalk Session
  52.  
  53.  
  54.        Instance variables for the command level can be created
  55.   by  assigning  a  value  to a new variable name.  Thereafter
  56.   that variable can be used at the command level, although  it
  57.   is  not  known within the scope of any method.  The variable
  58.   _________________________
  59.   * Smalltalk-80 is a trademark of the Xerox Corporation.
  60.  
  61.  
  62.  
  63.  
  64.                        September 19, 1986
  65.  
  66.  
  67.  
  68.  
  69.  
  70.                              - 2 -
  71.  
  72.  
  73.   ``last'' always contains the  value  returned  by  the  last
  74.   expression  typed.   Figure  2 shows the creation of a vari-
  75.   able.  Note that the assignment arrow is  formed  as  a  two
  76.   character sequence.
  77.  
  78.  
  79.                     newvar <- 2 / 3
  80.                     newvar
  81.                0.666667
  82.                     2 raisedTo: newvar + (4 / 3)
  83.                4
  84.                     last
  85.                4
  86.  
  87.  
  88.                   F✓F✓F✓Fi✓i✓i✓ig✓g✓g✓gu✓u✓u✓ur✓r✓r✓re✓e✓e✓e 2✓2✓2✓2:✓:✓:✓: Creating Variables
  89.  
  90.  
  91.        The default behavior is for the value  of  expressions,
  92.   with the exception of assignments, to be typed automatically
  93.   as they are evaluated.  This behavior can be modified either
  94.   by  using the -d flag (see Appendix 2), or by passing a mes-
  95.   sage to the pseudo variable s✓s✓s✓sm✓m✓m✓ma✓a✓a✓al✓l✓l✓ll✓l✓l✓lt✓t✓t✓ta✓a✓a✓al✓l✓l✓lk✓k✓k✓k (see Appendix 1).
  96.  
  97.        Class descriptions must be read  in  from  files,  they
  98.   cannot  be  entered  interactively.   Class descriptions are
  99.   entered using a system directive.  For example, to include a
  100.   class description contained in a file named n✓n✓n✓ne✓e✓e✓ew✓w✓w✓wc✓c✓c✓cl✓l✓l✓la✓a✓a✓as✓s✓s✓ss✓s✓s✓s.✓.✓.✓.s✓s✓s✓st✓t✓t✓t, the
  101.   following system directive should be issued:
  102.  
  103.                          )i newclass.st
  104.  
  105.   A list of files containing class descriptions  can  also  be
  106.   given as arguments to the st command.  The command
  107.  
  108.                       %st file1 ... filen
  109.   is equivalent to the sequence
  110.  
  111.                         %st
  112.                         Little Smalltalk
  113.                              )i file1
  114.                              ...
  115.                              )i filen
  116.  
  117.        A table of system directives is given in Figure 3.
  118.  
  119.        Note that the )e system directive invokes an editor  on
  120.   a file containing class descriptions, and then automatically
  121.   includes the file when the editor is  exited.  Classes  also
  122.   respond to the message e✓e✓e✓ed✓d✓d✓di✓i✓i✓it✓t✓t✓t, which will have the same effect
  123.   as the )e directive applied to the file containing the class
  124.   description.    Thus   the  typical  debug/edit/debug  cycle
  125.  
  126.  
  127.  
  128.                        September 19, 1986
  129.  
  130.  
  131.  
  132.  
  133.  
  134.                              - 3 -
  135.  
  136.  
  137.  
  138.  
  139.   _____________________________________________________________
  140.  
  141.    )e filename
  142.                  Edit the named file.   The  Little  Smalltalk
  143.                  system  will  suspend, leaving the user in an
  144.                  editor for making changes to the named  file.
  145.                  Upon  leaving  the editor the named file will
  146.                  automatically  be  included,  as  if  the  )i
  147.                  directive had been typed.
  148.  
  149.    )g filename
  150.                  Search for an entry  in  the  system  library
  151.                  area  matching  the  filename.  If found, the
  152.                  class descriptions in the library  entry  are
  153.                  included.    This   command   is  useful  for
  154.                  including commonly used classes that are  not
  155.                  part of the standard prelude, such as classes
  156.                  for statistics applications or graphics.
  157.  
  158.    )i filename
  159.                  Include  the  named  file.   The  file   must
  160.                  contain  one or more class descriptions.  The
  161.                  class  descriptions  are   parsed,   and   if
  162.                  syntactically  legal  new  instances of class
  163.                  C✓C✓C✓Cl✓l✓l✓la✓a✓a✓as✓s✓s✓ss✓s✓s✓s are added to the Smalltalk system.
  164.  
  165.    )l filename
  166.                  Load a previously saved environment from  the
  167.                  named   file.   The  current  values  of  all
  168.                  variables are overridden.  The file must have
  169.                  been created using the )s directive (below).
  170.  
  171.    )r filename
  172.                  Read the named file.  The file  must  contain
  173.                  Smalltalk  statements,  as  would be typed at
  174.                  the keyboard.  The effect is just as  if  the
  175.                  lines  of  the  file  had  been  typed at the
  176.                  keyboard.   The  file  cannot  contain  class
  177.                  descriptions.
  178.  
  179.    )s filename
  180.                  Save the current state  in  the  named  file.
  181.                  The  values  of  all variables are saved, and
  182.                  can later be reloaded using the )l  directive
  183.                  (above).
  184.  
  185.    )!string
  186.                  Execute the remainder of the  line  following
  187.                  the  exclamation  point  as  a Unix* command.
  188.                  Nothing  is  done  with  the  output  of  the
  189.                  command,  nor  is the returning status of the
  190.                  command recorded.
  191.  
  192.   _____________________________________________________________
  193.   |✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226.  
  227.  
  228.  
  229.  
  230.  
  231.  
  232.  
  233.  
  234.  
  235.  
  236.  
  237.                                                                |✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|✓|
  238.  
  239.  
  240.  
  241.  
  242.  
  243.  
  244.  
  245.  
  246.  
  247.  
  248.  
  249.  
  250.  
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.  
  263.  
  264.  
  265.  
  266.  
  267.  
  268.  
  269.  
  270.  
  271.  
  272.  
  273.  
  274.  
  275.  
  276.  
  277.  
  278.  
  279.  
  280.  
  281.  
  282.  
  283.  
  284.                   F✓F✓F✓Fi✓i✓i✓ig✓g✓g✓gu✓u✓u✓ur✓r✓r✓re✓e✓e✓e 3✓3✓3✓3:✓:✓:✓: System Directives
  285.  
  286.  
  287.  
  288.  
  289.  
  290.  
  291.                        September 19, 1986
  292.  
  293.  
  294.  
  295.  
  296.  
  297.                              - 4 -
  298.  
  299.  
  300.   involves repeated uses of the )e directive or the e✓e✓e✓ed✓d✓d✓di✓i✓i✓it✓t✓t✓t  mes-
  301.   sage  until  a  desired  outcome  is  achieved.   The editor
  302.   invoked by the )e directive can be changed  by  setting  the
  303.   EDITOR variable in the users environment.
  304.  
  305.   _✓3.  _✓D_✓i_✓f_✓f_✓e_✓r_✓e_✓n_✓c_✓e_✓s _✓b_✓e_✓t_✓w_✓e_✓e_✓n _✓L_✓i_✓t_✓t_✓l_✓e _✓S_✓m_✓a_✓l_✓l_✓t_✓a_✓l_✓k _✓a_✓n_✓d _✓t_✓h_✓e  _✓S_✓m_✓a_✓l_✓l_✓t_✓a_✓l_✓k-
  306.   _✓8_✓0 _✓s_✓y_✓s_✓t_✓e_✓m
  307.  
  308.        This section  describes  the  differences  between  the
  309.   language  accepted  by  the  Little Smalltalk system and the
  310.   language described in  [.Smalltalk  blue.].   The  principal
  311.   reasons for these changes are as follows:
  312.  
  313.   size  Classes which are largely unnecessary, or which  could
  314.         be  easily  simulated  by other classes (e.g. Associa-
  315.         tion, SortedCollection) have been  eliminated  in  the
  316.         interest  of  keeping the size of the standard library
  317.         as small as  possible.   Similarly,  indexed  instance
  318.         variables  are  not  supported,  since  to do so would
  319.         increase the size of every object in the  system,  and
  320.         they can be easily simulated in those classes in which
  321.         they are important (see below).
  322.  
  323.   portability
  324.         Classes which depend upon  particular  hardware  (e.g.
  325.         BitBlt)  are  not  included  as  part  of  the  Little
  326.         Smalltalk system.  The basic  system  assumes  nothing
  327.         more than ascii terminals.
  328.  
  329.   representation
  330.         The  need  for  a  textual  representation  for  class
  331.         descriptions required some small additions to the syn-
  332.         tax for class methods (see  Appendix  3).   Similarly,
  333.         the fact that classes and subclasses can be separately
  334.         parsed, in either order, forced some  changes  in  the
  335.         scoping rules for instance variables.
  336.  
  337.        The following sections describe these changes  in  more
  338.   detail.
  339.  
  340.   _✓3._✓1.  _✓N_✓o _✓B_✓r_✓o_✓w_✓s_✓e_✓r
  341.  
  342.        The Smalltalk-80 Programming Environment  described  in
  343.   [.Smalltalk  orange.]  is not included as part of the Little
  344.   Smalltalk system.  The Little Smalltalk system  is  designed
  345.   to  be  little, easily portable, and to rely on nothing more
  346.   than basic terminal capabilities.
  347.  
  348.   _✓3._✓2.  _✓I_✓n_✓t_✓e_✓r_✓n_✓a_✓l _✓R_✓e_✓p_✓r_✓e_✓s_✓e_✓n_✓t_✓a_✓t_✓i_✓o_✓n _✓D_✓i_✓f_✓f_✓e_✓r_✓e_✓n_✓t
  349.  
  350.        The  internal  representations  of  objects,  including
  351.   processes,  interpreters,  and  bytecodes,  is entirely dif-
  352.   ferent in the Little Smalltalk system from the  Smalltalk-80
  353.   system described in [.Smalltalk blue.].
  354.   _________________________
  355.   * Unix is a trademark of Bell Laboratories.
  356.  
  357.                        September 19, 1986
  358.  
  359.  
  360.  
  361.  
  362.  
  363.                              - 5 -
  364.  
  365.  
  366.   _✓3._✓3.  _✓F_✓e_✓w_✓e_✓r _✓C_✓l_✓a_✓s_✓s_✓e_✓s
  367.  
  368.        Many of the classes described in [.Smalltalk blue.] are
  369.   not  included  as part of the Little Smalltalk basic system.
  370.   Some of these are not necessary because of the decision  not
  371.   to  include  the  editor,  browser, and so on as part of the
  372.   basic system.  Others are omitted in the interest of keeping
  373.   the  standard  library of classes small.  A complete list of
  374.   included classes for the Little Smalltalk system is given in
  375.   Appendix 1.
  376.  
  377.   _✓3._✓4.  _✓N_✓o _✓C_✓l_✓a_✓s_✓s _✓P_✓r_✓o_✓t_✓o_✓c_✓o_✓l
  378.  
  379.        Protocol for all classes is defined as  part  of  class
  380.   C✓C✓C✓Cl✓l✓l✓la✓a✓a✓as✓s✓s✓ss✓s✓s✓s.   It  is  not  possible to redefine class protocol as
  381.   part of a class description, only  instance  protocol.   The
  382.   notion of metaclasses is not supported.
  383.  
  384.   _✓3._✓5.  _✓C_✓a_✓s_✓c_✓a_✓d_✓e_✓s _✓D_✓i_✓f_✓f_✓e_✓r_✓e_✓n_✓t
  385.  
  386.        The semantics of cascades has been simplified and  gen-
  387.   eralized.  The result of a cascaded expression is always the
  388.   result of the expression to the left of the first semicolon,
  389.   which is also the receiver for each subsequent continuation.
  390.   Continuations can include multiple messages.  A rather  non-
  391.   sensical, but illustrative, example is the following:
  392.  
  393.                      2 + 3 ; - 7 + 3 ; * 4
  394.  
  395.  
  396.   The result of this expression is 5 (the value yielded by 2 +
  397.   3).   5  is  also the receiver for the message - 7, and that
  398.   result (-2) is in turn the receiver for  the  message  +  3.
  399.   This  last  result  is thrown away.  5 is then again used as
  400.   the receiver for the message * 4, the  result  of  which  is
  401.   also thrown away.
  402.  
  403.   _✓3._✓6.  _✓I_✓n_✓s_✓t_✓a_✓n_✓c_✓e _✓V_✓a_✓r_✓i_✓a_✓b_✓l_✓e _✓N_✓a_✓m_✓e _✓S_✓c_✓o_✓p_✓e
  404.  
  405.        In the language described  in  [.Smalltalk  blue.],  an
  406.   instance variable is known not only to the class protocol in
  407.   which it is declared, but is also valid in  methods  defined
  408.   for  any  subclasses of that class.  In the Little Smalltalk
  409.   system an instance variable can be  referenced  only  within
  410.   the protocol for the class in which it is declared.
  411.  
  412.   _✓3._✓7.  _✓I_✓n_✓d_✓e_✓x_✓e_✓d _✓I_✓n_✓s_✓t_✓a_✓n_✓c_✓e _✓V_✓a_✓r_✓i_✓a_✓b_✓l_✓e_✓s
  413.  
  414.        Implicitly defined indexed instance variables  are  not
  415.   supported.   In  any  class for which these are desired they
  416.   can be easily simulated by including an additional  instance
  417.   variable,  containing  an Array, and including the following
  418.   methods:
  419.  
  420.  
  421.  
  422.  
  423.                        September 19, 1986
  424.  
  425.  
  426.  
  427.  
  428.  
  429.                              - 6 -
  430.  
  431.  
  432.  
  433.            Class Whatever
  434.            | indexVars |
  435.            [
  436.                new: size
  437.                    indexVars <- Array new: size
  438.  
  439.            |   at: location
  440.                    |✓^ indexVars at: location
  441.  
  442.            |   at: location put: value
  443.                    indexVars at: location put: value
  444.  
  445.                ...
  446.  
  447.  
  448.  
  449.        The message new: can be used with any  class,  with  an
  450.   effect  similar  to  new.  That is, if a new instance of the
  451.   class is created by sending the message new:  to  the  class
  452.   variable,  the  message  is immediately passed on to the new
  453.   instance, and the result returned is used as the  result  of
  454.   the creation message.
  455.  
  456.   _✓3._✓8.  _✓N_✓o _✓P_✓o_✓o_✓l _✓V_✓a_✓r_✓i_✓a_✓b_✓l_✓e_✓s
  457.  
  458.        The concepts of pool variables,  global  variables,  or
  459.   class  variables are not supported.  In their place there is
  460.   a new pseudo-variable, s✓s✓s✓sm✓m✓m✓ma✓a✓a✓al✓l✓l✓ll✓l✓l✓lt✓t✓t✓ta✓a✓a✓al✓l✓l✓lk✓k✓k✓k, which responds to the mes-
  461.   sages  a✓a✓a✓at✓t✓t✓t:✓:✓:✓: and a✓a✓a✓at✓t✓t✓t:✓:✓:✓:p✓p✓p✓pu✓u✓u✓ut✓t✓t✓t:✓:✓:✓:.  The keys for this collection can be
  462.   arbitrary.  Although this facility is available, its use  is
  463.   often a sign of poor program design, and should be avoided.
  464.  
  465.   _✓3._✓9.  _✓N_✓o _✓A_✓s_✓s_✓o_✓c_✓i_✓a_✓t_✓i_✓o_✓n_✓s
  466.  
  467.        The class Dictionary stores keys and values separately,
  468.   rather than as instances of Association.  The class Associa-
  469.   tion, and all messages referring to Associations  have  been
  470.   removed.
  471.  
  472.   _✓3._✓1_✓0.  _✓G_✓e_✓n_✓e_✓r_✓a_✓t_✓o_✓r_✓s _✓i_✓n _✓p_✓l_✓a_✓c_✓e _✓o_✓f _✓S_✓t_✓r_✓e_✓a_✓m_✓s
  473.  
  474.        The notion of stream has been replaced by the  slightly
  475.   different notion of _✓g_✓e_✓n_✓e_✓r_✓a_✓t_✓o_✓r_✓s, in particular the use of the
  476.   messages _✓f_✓i_✓r_✓s_✓t and _✓n_✓e_✓x_✓t in subclasses of C✓C✓C✓Co✓o✓o✓ol✓l✓l✓ll✓l✓l✓le✓e✓e✓ec✓c✓c✓ct✓t✓t✓ti✓i✓i✓io✓o✓o✓on✓n✓n✓n.  Exter-
  477.   nal files are supported by an explicit class F✓F✓F✓Fi✓i✓i✓il✓l✓l✓le✓e✓e✓e.
  478.  
  479.   _✓3._✓1_✓1.  _✓P_✓r_✓i_✓m_✓i_✓t_✓i_✓v_✓e_✓s _✓D_✓i_✓f_✓f_✓e_✓r_✓e_✓n_✓t
  480.  
  481.        Both the syntax and the  use  of  primitives  has  been
  482.   changed.    Primitives  provide  an  interface  between  the
  483.   Smalltalk world and the underlying  system,  permitting  the
  484.   execution   of   operations  that  cannot  be  specified  in
  485.   Smalltalk.  In Little Smalltalk, primitives cannot fail  and
  486.  
  487.  
  488.  
  489.                        September 19, 1986
  490.  
  491.  
  492.  
  493.  
  494.  
  495.                              - 7 -
  496.  
  497.  
  498.   must return a value (although they may, in error situations,
  499.   print an error message and  return  n✓n✓n✓ni✓i✓i✓il✓l✓l✓l).   The  syntax  for
  500.   primitives  has  been altered to permit the specification of
  501.   primitives with an arbitrary number of arguments.  The  for-
  502.   mat for a primitive call is as follows:
  503.  
  504.                 <primitive n✓n✓n✓nu✓u✓u✓um✓m✓m✓mb✓b✓b✓be✓e✓e✓er✓r✓r✓r _✓a_✓r_✓g_✓u_✓m_✓e_✓n_✓t_✓l_✓i_✓s_✓t >
  505.  
  506.   Where n✓n✓n✓nu✓u✓u✓um✓m✓m✓mb✓b✓b✓be✓e✓e✓er✓r✓r✓r is the number of the primitive to  be  executed
  507.   (which  must be a value between 1 and 255), and _✓a_✓r_✓g_✓u_✓m_✓e_✓n_✓t_✓l_✓i_✓s_✓t
  508.   is a list of Smalltalk primary expressions (see Appendix 2).
  509.   Appendix  4  lists  the  meanings  of  each of the currently
  510.   recognized primitive numbers.
  511.  
  512.   _✓3._✓1_✓2.  _✓B_✓y_✓t_✓e _✓A_✓r_✓r_✓a_✓y_✓s
  513.  
  514.        A new syntax has been created  for  defining  an  array
  515.   composed  entirely  of unsigned integers in the range 0-255.
  516.   These arrays are given a very tight encoding.  The syntax is
  517.   a pound sign, followed by a left square brace, followed by a
  518.   sequence of numbers in the range 0 to  255,  followed  by  a
  519.   right square brace.
  520.  
  521.                           #[ _✓n_✓u_✓m_✓b_✓e_✓r_✓s ]
  522.  
  523.  
  524.   Byte Arrays are used extensively internally.
  525.  
  526.   _✓3._✓1_✓3.  _✓N_✓e_✓w _✓P_✓s_✓e_✓u_✓d_✓o _✓V_✓a_✓r_✓i_✓a_✓b_✓l_✓e_✓s
  527.  
  528.        In addition to the pseudo  variable  s✓s✓s✓sm✓m✓m✓ma✓a✓a✓al✓l✓l✓ll✓l✓l✓lt✓t✓t✓ta✓a✓a✓al✓l✓l✓lk✓k✓k✓k  already
  529.   mentioned,  another  pseudo  variable, s✓s✓s✓se✓e✓e✓el✓l✓l✓lf✓f✓f✓fP✓P✓P✓Pr✓r✓r✓ro✓o✓o✓oc✓c✓c✓ce✓e✓e✓es✓s✓s✓ss✓s✓s✓s, has beed
  530.   added to the Little Smalltalk system.   s✓s✓s✓se✓e✓e✓el✓l✓l✓lf✓f✓f✓fP✓P✓P✓Pr✓r✓r✓ro✓o✓o✓oc✓c✓c✓ce✓e✓e✓es✓s✓s✓ss✓s✓s✓s  returns
  531.   the currently executing process, which can then be passed as
  532.   an argument to a semaphore, or be used as a receiver  for  a
  533.   message  valid  for  class  P✓P✓P✓Pr✓r✓r✓ro✓o✓o✓oc✓c✓c✓ce✓e✓e✓es✓s✓s✓ss✓s✓s✓s.   Like  s✓s✓s✓se✓e✓e✓el✓l✓l✓lf✓f✓f✓f and s✓s✓s✓su✓u✓u✓up✓p✓p✓pe✓e✓e✓er✓r✓r✓r,
  534.   s✓s✓s✓se✓e✓e✓el✓l✓l✓lf✓f✓f✓fP✓P✓P✓Pr✓r✓r✓ro✓o✓o✓oc✓c✓c✓ce✓e✓e✓es✓s✓s✓ss✓s✓s✓s cannot be used at the command level.
  535.  
  536.   _✓3._✓1_✓4.  _✓N_✓o _✓D_✓e_✓p_✓e_✓n_✓d_✓e_✓n_✓c_✓y
  537.  
  538.        The notion  of  dependency,  and  automatic  dependency
  539.   updating, is not included in Little Smalltalk.
  540.  
  541.  
  542.  
  543.  
  544.  
  545.  
  546.  
  547.  
  548.  
  549.  
  550.  
  551.  
  552.  
  553.  
  554.  
  555.                        September 19, 1986
  556.  
  557.  
  558.  
  559.  
  560.  
  561.  
  562.  
  563.  
  564.                            _✓A_✓p_✓p_✓e_✓n_✓d_✓i_✓x _✓1
  565.                        _✓C_✓l_✓a_✓s_✓s _✓D_✓e_✓s_✓c_✓r_✓i_✓p_✓t_✓i_✓o_✓n_✓s
  566.  
  567.        The messages accepted by the classes  included  in  the
  568.   Little  Smalltalk standard library are described in the fol-
  569.   lowing pages. A list of the classes defined, where  indenta-
  570.   tion is used to imply subclassing, is given below:
  571.  
  572.           Object
  573.              UndefinedObject
  574.              Symbol
  575.              Boolean
  576.                 True
  577.                 False
  578.              Magnitude
  579.                 Char
  580.                 Number
  581.                    Integer
  582.                    Float
  583.                 Radian
  584.                 Point
  585.              Random
  586.              Collection
  587.                 Bag
  588.                 Set
  589.                 KeyedCollection
  590.                    Dictionary
  591.                       Smalltalk
  592.                    File
  593.                    SequenceableCollection
  594.                       Interval
  595.                       LinkedList
  596.                          Semaphore
  597.                       File
  598.                       ArrayedCollection
  599.                          Array
  600.                          ByteArray
  601.                          String
  602.              Block
  603.              Class
  604.              Process
  605.  
  606.  
  607.        In the descriptions of each message the following notes
  608.   may occur:
  609.  
  610.   _✓d    Indicates the effect of the  message  differs  slightly
  611.        from that given in [.Smalltalk blue.].
  612.  
  613.   _✓n    Indicates the message is not included as  part  of  the
  614.        language defined in [.Smalltalk blue.].
  615.  
  616.   _✓r    Indicates the protocol for the message overrides a pro-
  617.        tocol given in some superclass.  Only where the logical
  618.  
  619.  
  620.  
  621.                        September 19, 1986
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.        effect of this overriding is important is  the  message
  631.        given  a  second time; some messages, such as copy, are
  632.        overridden in many classes but are not described in the
  633.        documentation  because  the  logical effect remains the
  634.        same.
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.  
  659.  
  660.  
  661.  
  662.  
  663.  
  664.  
  665.  
  666.  
  667.  
  668.  
  669.  
  670.  
  671.  
  672.  
  673.  
  674.  
  675.  
  676.  
  677.  
  678.  
  679.  
  680.  
  681.  
  682.  
  683.  
  684.  
  685.  
  686.  
  687.                        September 19, 1986
  688.  
  689.  
  690.  
  691.  
  692.  
  693.  
  694.  
  695.  
  696.                            _✓A_✓p_✓p_✓e_✓n_✓d_✓i_✓x _✓2
  697.                             _✓M_✓a_✓n _✓P_✓a_✓g_✓e
  698.  
  699.        A Unix man page for the st command is given on the fol-
  700.   lowing page.
  701.  
  702.  
  703.  
  704.  
  705.  
  706.  
  707.  
  708.  
  709.  
  710.  
  711.  
  712.  
  713.  
  714.  
  715.  
  716.  
  717.  
  718.  
  719.  
  720.  
  721.  
  722.  
  723.  
  724.  
  725.  
  726.  
  727.  
  728.  
  729.  
  730.  
  731.  
  732.  
  733.  
  734.  
  735.  
  736.  
  737.  
  738.  
  739.  
  740.  
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748.  
  749.  
  750.  
  751.  
  752.  
  753.                        September 19, 1986
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.                            _✓A_✓p_✓p_✓e_✓n_✓d_✓i_✓x _✓3
  763.                          _✓S_✓y_✓n_✓t_✓a_✓x _✓C_✓h_✓a_✓r_✓t_✓s
  764.  
  765.        Syntax charts for the language accepted by  the  Little
  766.   Smalltalk  system are described on the following pages.  The
  767.   following is an example class description:
  768.  
  769.   Class Set :Collection
  770.   | dict |
  771.   [
  772.           new
  773.                   dict <- Dictionary new
  774.  
  775.   |       add: newElement
  776.                   dict at: newElement
  777.                        ifAbsent: [dict at: newElement put: 1]
  778.  
  779.   |       remove: oldElement ifAbsent: exceptionBlock
  780.                   dict removeKey: oldElement ifAbsent: exceptionBlock
  781.  
  782.   |       size
  783.                   |✓^ dict size
  784.  
  785.   |       occurrencesOf: anElement
  786.                   |✓^ dict at: anElement ifAbsent: [0]
  787.  
  788.   |       first
  789.                   dict first.
  790.                   |✓^ dict currentKey
  791.  
  792.   |       next
  793.                   dict next.
  794.                   |✓^ dict currentKey
  795.  
  796.   ]
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806.  
  807.  
  808.  
  809.  
  810.  
  811.  
  812.  
  813.  
  814.  
  815.  
  816.  
  817.  
  818.  
  819.                        September 19, 1986
  820.  
  821.  
  822.  
  823.  
  824.  
  825.  
  826.  
  827.  
  828.                            _✓A_✓p_✓p_✓e_✓n_✓d_✓i_✓x _✓4
  829.                        _✓P_✓r_✓i_✓m_✓i_✓t_✓i_✓v_✓e _✓N_✓u_✓m_✓b_✓e_✓r_✓s
  830.  
  831.        The following chart gives  the  function  performed  by
  832.   each primitive in the Little Smalltalk system.
  833.  
  834.   _✓I_✓n_✓f_✓o_✓r_✓m_✓a_✓t_✓i_✓o_✓n _✓a_✓b_✓o_✓u_✓t _✓o_✓b_✓j_✓e_✓c_✓t_✓s
  835.  
  836.   0    (not used )
  837.  
  838.   1    class of an object
  839.  
  840.   2    superobject of an object
  841.  
  842.   3    test if class responds to new
  843.  
  844.   4    size of object
  845.  
  846.   5    hash value
  847.  
  848.   6    test if two built-in objects are of the same type
  849.  
  850.   7    object equality testing ( == )
  851.  
  852.   8    various switch toggles
  853.  
  854.   9    numerical generality testing
  855.  
  856.   _✓I_✓n_✓t_✓e_✓g_✓e_✓r _✓m_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n
  857.  
  858.   10   integer addition (both args must be integer)
  859.  
  860.   11   integer subtraction
  861.  
  862.   12   integer < test
  863.  
  864.   13   integer > test
  865.  
  866.   14   integer <✓_ test
  867.  
  868.   15   integer >✓_ test
  869.  
  870.   16   integer = test
  871.  
  872.   17   integer ~= test
  873.  
  874.   18   integer multiplication
  875.  
  876.   19   integer //
  877.  
  878.   _✓B_✓i_✓t _✓m_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n _✓a_✓n_✓d _✓o_✓t_✓h_✓e_✓r _✓i_✓n_✓t_✓e_✓g_✓e_✓r _✓v_✓a_✓l_✓u_✓e_✓d _✓f_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s
  879.  
  880.   20   gcd:
  881.  
  882.  
  883.  
  884.  
  885.                        September 19, 1986
  886.  
  887.  
  888.  
  889.  
  890.  
  891.  
  892.  
  893.  
  894.   21   bitAt:
  895.  
  896.   22   bitOr:
  897.  
  898.   23   bitAnd:
  899.  
  900.   24   bitXor:
  901.  
  902.   25   bitShift:
  903.  
  904.   26   radix:
  905.  
  906.   27   not used
  907.  
  908.   28   integer quo:
  909.  
  910.   29   integer rem:
  911.  
  912.   _✓O_✓t_✓h_✓e_✓r _✓i_✓n_✓t_✓e_✓g_✓e_✓r _✓f_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s
  913.  
  914.   30   doPrimitive:withArguments:
  915.  
  916.   31   not used
  917.  
  918.   32   convert random integer to random float
  919.  
  920.   33   bitInvert
  921.  
  922.   34   highBit
  923.  
  924.   35   randomNumber (argument is seed )
  925.  
  926.   36   asCharacter
  927.  
  928.   37   asString
  929.  
  930.   38   factorial
  931.  
  932.   39   asFloat
  933.  
  934.   _✓C_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r _✓m_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n
  935.  
  936.   40   not used
  937.  
  938.   41.  not used
  939.  
  940.   42   character < test
  941.  
  942.   43   character > test
  943.  
  944.   44   character <✓_ test
  945.  
  946.   45   character >✓_ test
  947.  
  948.  
  949.  
  950.  
  951.                        September 19, 1986
  952.  
  953.  
  954.  
  955.  
  956.  
  957.  
  958.  
  959.  
  960.   46   character = test
  961.  
  962.   47   character ~= test
  963.  
  964.   48   not used
  965.  
  966.   49   not used
  967.  
  968.   _✓C_✓h_✓a_✓r_✓a_✓c_✓t_✓e_✓r _✓u_✓n_✓a_✓r_✓y _✓f_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s
  969.  
  970.   50   digitValue
  971.  
  972.   51   isVowel
  973.  
  974.   52   isLetter
  975.  
  976.   53   isLowerCase
  977.  
  978.   54   isUpperCase
  979.  
  980.   55   isSeparator
  981.  
  982.   56   isAlphaNumeric
  983.  
  984.   57   caseShift
  985.  
  986.   58   asString
  987.  
  988.   59   asciiValue
  989.  
  990.   _✓F_✓l_✓o_✓a_✓t_✓i_✓n_✓g _✓p_✓o_✓i_✓n_✓t _✓m_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n
  991.  
  992.   60   floating point addition (both args must be float)
  993.  
  994.   61   floating point subtraction
  995.  
  996.   62   floating point < test
  997.  
  998.   63   floating point > test
  999.  
  1000.   64   floating point <✓_ test
  1001.  
  1002.   65   floating point >✓_ test
  1003.  
  1004.   66   floating point = test
  1005.  
  1006.   67   floating point ~= test
  1007.  
  1008.   68   floating point multiplication
  1009.  
  1010.   69   floating point division
  1011.  
  1012.  
  1013.  
  1014.  
  1015.  
  1016.  
  1017.                        September 19, 1986
  1018.  
  1019.  
  1020.  
  1021.  
  1022.  
  1023.  
  1024.  
  1025.  
  1026.   _✓O_✓t_✓h_✓e_✓r _✓f_✓l_✓o_✓a_✓t_✓i_✓n_✓g _✓p_✓o_✓i_✓n_✓t _✓o_✓p_✓e_✓r_✓a_✓t_✓i_✓o_✓n_✓s
  1027.  
  1028.   70   ln
  1029.  
  1030.   71   sqrt
  1031.  
  1032.   72   floor
  1033.  
  1034.   73   ceiling
  1035.  
  1036.   74   not used
  1037.  
  1038.   75   integerPart
  1039.  
  1040.   76   fractionalPart
  1041.  
  1042.   77   gamma
  1043.  
  1044.   78   asString
  1045.  
  1046.   79   exp
  1047.  
  1048.   _✓O_✓t_✓h_✓e_✓r _✓n_✓u_✓m_✓e_✓r_✓i_✓c_✓a_✓l _✓f_✓u_✓n_✓c_✓t_✓i_✓o_✓n_✓s
  1049.  
  1050.   80   normalize number to be within 0 and 2J.
  1051.  
  1052.   81   sin
  1053.  
  1054.   82   cos
  1055.  
  1056.   83   not used
  1057.  
  1058.   84   arcSin
  1059.  
  1060.   85   arcCos
  1061.  
  1062.   86   arcTan
  1063.  
  1064.   87   not used
  1065.  
  1066.   88   raisedTo:
  1067.  
  1068.   89   radix:
  1069.  
  1070.   _✓S_✓y_✓m_✓b_✓o_✓l _✓C_✓o_✓m_✓m_✓a_✓n_✓d_✓s
  1071.  
  1072.   90.  not used
  1073.  
  1074.   91   symbol comparison, returns true or false.
  1075.  
  1076.   92   printString
  1077.  
  1078.   93   asString
  1079.  
  1080.  
  1081.  
  1082.  
  1083.                        September 19, 1986
  1084.  
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.   94   print (used internally)
  1093.  
  1094.   95   not used
  1095.  
  1096.   96   not used
  1097.  
  1098.   97   build a new class, arguments are class name, superclass
  1099.        name,  instance  variables,  messages, methods, context
  1100.        size.
  1101.  
  1102.   98   insert an object into class dictionary, first  argument
  1103.        is symbol, second argument is class definition
  1104.  
  1105.   99   find an object in class dictionary.  argument  is  sym-
  1106.        bol.
  1107.  
  1108.   _✓S_✓t_✓r_✓i_✓n_✓g _✓o_✓p_✓e_✓r_✓a_✓t_✓i_✓o_✓n_✓s
  1109.  
  1110.   100  string length
  1111.  
  1112.   101  string compare, case important - return -1, 0 or 1.
  1113.  
  1114.   102  string compare, case not important
  1115.  
  1116.   103  string catenation
  1117.  
  1118.   104  string at:
  1119.  
  1120.   105  string at:put:
  1121.  
  1122.   106  copyFrom:length:
  1123.  
  1124.   107  copy (new string with same chars)
  1125.  
  1126.   108  asSymbol
  1127.  
  1128.   109  string printString
  1129.  
  1130.   _✓A_✓r_✓r_✓a_✓y _✓m_✓a_✓n_✓i_✓p_✓u_✓l_✓a_✓t_✓i_✓o_✓n
  1131.  
  1132.   110  build an untyped object  of  given  size,  argument  is
  1133.        integer size.
  1134.  
  1135.   111  index variable get (first argument is object, second is
  1136.        index)
  1137.  
  1138.   112  index variable put (first argument is object, second is
  1139.        index, third argument is expression)
  1140.  
  1141.   113  object grow (returns a new object  with  same  instance
  1142.        variable  values  as  first  argument,  but with second
  1143.        argument tacked on end as new instance variable)
  1144.  
  1145.   114  build an instance of A✓A✓A✓Ar✓r✓r✓rr✓r✓r✓ra✓a✓a✓ay✓y✓y✓y of the given size.
  1146.  
  1147.  
  1148.  
  1149.                        September 19, 1986
  1150.  
  1151.  
  1152.  
  1153.  
  1154.  
  1155.  
  1156.  
  1157.  
  1158.   115  new string of given size
  1159.  
  1160.   116  ByteArray new:
  1161.  
  1162.   117  ByteArray size
  1163.  
  1164.   118  ByteArray at:
  1165.  
  1166.   119  ByteArray at:put:
  1167.  
  1168.   _✓O_✓u_✓t_✓p_✓u_✓t _✓a_✓n_✓d _✓e_✓r_✓r_✓o_✓r _✓m_✓e_✓s_✓s_✓a_✓g_✓e_✓s
  1169.  
  1170.   120  print string with no return
  1171.  
  1172.   121  print string with return
  1173.  
  1174.   122  general error - first argument is receiver,  second  is
  1175.        error string
  1176.  
  1177.   123  print string on error output (with return)
  1178.  
  1179.   124  not used
  1180.  
  1181.   125  unix system call
  1182.  
  1183.   126  print a string at a specific point on the terminal
  1184.  
  1185.   127  block return without surrounding context
  1186.  
  1187.   128  reference count  less  than  zero,  first  argument  is
  1188.        guilty object
  1189.  
  1190.   129  does not respond error,  first  argument  is  receiver,
  1191.        second is message.
  1192.  
  1193.   _✓F_✓i_✓l_✓e _✓o_✓p_✓e_✓r_✓a_✓t_✓i_✓o_✓n_✓s
  1194.  
  1195.   130  file open, first argument is name, second  argument  is
  1196.        mode
  1197.  
  1198.   131  file read
  1199.  
  1200.   132  file write
  1201.  
  1202.   133  set file mode, first argument is file, second  is  mode
  1203.        indicator (anInteger)
  1204.  
  1205.   134  compute file size in bytes
  1206.  
  1207.   135  file set location (at:)  second  argument  is  location
  1208.        (anInteger)
  1209.  
  1210.   136  return current file offset in bytes
  1211.  
  1212.  
  1213.  
  1214.  
  1215.                        September 19, 1986
  1216.  
  1217.  
  1218.  
  1219.  
  1220.  
  1221.  
  1222.  
  1223.  
  1224.   137  not used
  1225.  
  1226.   138  not used
  1227.  
  1228.   139  not used
  1229.  
  1230.   _✓P_✓r_✓o_✓c_✓e_✓s_✓s _✓m_✓a_✓n_✓a_✓g_✓e_✓m_✓e_✓n_✓t
  1231.  
  1232.   140  block execute (trapped by interpreter)
  1233.  
  1234.   141  new process (withArguments:)
  1235.  
  1236.   142  terminate a process
  1237.  
  1238.   143  perform:withArguments: (trapped by interpreter)
  1239.  
  1240.   144. not used
  1241.  
  1242.   145  set state
  1243.  
  1244.   146  return state
  1245.  
  1246.   148  start atomic action
  1247.  
  1248.   149  end atomic action
  1249.  
  1250.   _✓O_✓p_✓e_✓r_✓a_✓t_✓i_✓o_✓n_✓s _✓o_✓n _✓c_✓l_✓a_✓s_✓s_✓e_✓s
  1251.  
  1252.   150  class edit
  1253.  
  1254.   151  superclass of a class
  1255.  
  1256.   152  class name (a Symbol)
  1257.  
  1258.   153  new instance of a class
  1259.  
  1260.   154  list all commands class responds to
  1261.  
  1262.   155  respondsTo: , second argument is a symbol
  1263.  
  1264.   156  class view (drop into editor, but no include)
  1265.  
  1266.   157  class list
  1267.  
  1268.   158  variables (returns an array of symbols)
  1269.  
  1270.   159  not used
  1271.  
  1272.   _✓D_✓a_✓t_✓e _✓a_✓n_✓d _✓T_✓i_✓m_✓e
  1273.  
  1274.   160  current date and time as string
  1275.  
  1276.   161  seconds time counter
  1277.  
  1278.  
  1279.  
  1280.  
  1281.                        September 19, 1986
  1282.  
  1283.  
  1284.  
  1285.  
  1286.  
  1287.  
  1288.  
  1289.  
  1290.   162  clear the screen
  1291.  
  1292.   _✓P_✓l_✓o_✓t(_✓3) _✓i_✓n_✓t_✓e_✓r_✓f_✓a_✓c_✓e
  1293.  
  1294.   170  clear the screen
  1295.  
  1296.   171  move the cursor (move(x,y))
  1297.  
  1298.   172  draw a line (cont(x,y))
  1299.  
  1300.   173  draw a point (point(x,y))
  1301.  
  1302.   174  draw a circle (circle(x,y,r))
  1303.  
  1304.   175  draw an arc (arc(x,y,x0,y0,x1,y1))
  1305.  
  1306.   176  establish the coordinate space (space(a,b,c,d))
  1307.  
  1308.   177  draw a line (line(a,b,c,d))
  1309.  
  1310.   178  print a label (label(s))
  1311.  
  1312.   179  establish a line type (linemod(s))
  1313.  
  1314.  
  1315.  
  1316.  
  1317.  
  1318.  
  1319.  
  1320.  
  1321.  
  1322.  
  1323.  
  1324.  
  1325.  
  1326.  
  1327.  
  1328.  
  1329.  
  1330.  
  1331.  
  1332.  
  1333.  
  1334.  
  1335.  
  1336.  
  1337.  
  1338.  
  1339.  
  1340.  
  1341.  
  1342.  
  1343.  
  1344.  
  1345.  
  1346.  
  1347.                        September 19, 1986
  1348.  
  1349.  
  1350.